<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="content-style-type" content="text/css" />
</head>
<body>
<?php	
require_once("../classes/database.php"); 
require_once("../functions/functions.php"); 
require_once("../classes/generate_form.php"); 
require_once('../classes/html_cleanup.php');
include "function.php"; 
include "simple_html_dom.php"; 

$new_title        = getValue('new_title',"str","POST");
$new_title_md5    = getValue('new_title_md5',"str","POST");
$new_intro        = getValue('new_intro',"str","POST");
$new_cat_id       = getValue('new_cat_id',"str","POST");
$new_avatar       = getValue('new_avatar',"str","POST");
$new_description  = getValue('new_description',"str","POST");

$new_web_id          = getValue('new_web_id',"str","POST");
$new_link_detail     = getValue('new_link_detail',"str","POST");
$new_link_detail_md5 = getValue('new_link_detail_md5',"str","POST");
$new_time            = getValue('new_time',"str","POST");


$code             = getValue('code',"str","POST");
$new_description  = base64_decode($new_description);
$code2            = md5($new_title . "sondvhoc" . date("z") . $new_cat_id);
$new_title        = replaceMQ($new_title);
$new_intro        = replaceMQ($new_intro);
$new_description  = replaceMQ($new_description); 

if($code == $code2){
   echo "ok roi";
   echo "<br/>";
     
   $tableInsert   = "tn_news2";
   $queryInsert   = "INSERT IGNORE INTO " . $tableInsert . "(new_title,new_title_md5,new_avatar,new_intro,new_cat_id,
                     new_description,new_web_id,new_link_detail,new_link_detail_md5,new_time) 
                     VALUES('" . $new_title . "','" . $new_title_md5 . "','" . $new_avatar . "','" . $new_intro . "','" . $new_cat_id . "',
                     '" . $new_description . "','" . intval($new_web_id) . "','" . $new_link_detail . "','" . $new_link_detail_md5 . "','" . intval($new_time) . "') ";
   //$dbInsert      = new db_execute($queryInsert);
   $db = Yii::app()->db;
   $cmd = $db->createCommand($queryInsert);
   $cmd->execute();
}else{
   echo "da sai";
}

?> 
</body>
</html>  
